package com.qiyang.lambda;

/**
 * Created on 2018/8/4.
 *
 * @author sehuaqi.
 * 描述：
 */
public class LambdaDemo1 {


    public static void main(String args[]) {
        //执行函数
        Object target1 = new Runnable() {
            @Override
            public void run() {
                System.out.println("多线程执行");
            }
        };

        new Thread((Runnable)target1).start();

        //jdk8 lambda
        Object target2 = (Runnable)() -> System.out.printf("多线程执行，这是lambda写法");
        Runnable target3 = () -> System.out.printf("多线程执行，这是lambda写法");

        System.out.println(target2 == target3);

        new Thread((Runnable)target2).start();

    }

}
